Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to the mem.Arena allocator procedure, allowing for in-place growth. #4863

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Byron-Hodel
Copy link

I added some arena_resize procedures for the mem.Arena allocator, supporting the following features:

  • In-place growth when no memory is allocated after the block.
  • Freeing allocations if no subsequent allocations exist (size == 0).
  • Allocating a new block and copying data when in-place growth isn't possible.

In the case that an allocation is freed when calling the resize procedure, any padding before the actual allocation will not be removed since there is no good way (as far as I could tell) to determine the amount of padding with what is given.

Note: this is basically a copy of my previous pull request because I unknowingly modified my previous pull request. Apparently force pushing to my fork's master branch is a terrible idea. Because I am not a Github wizard, I decided to close it and create a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant